Improved detection logic for package manager#171
Open
navidemad wants to merge 2 commits into
Open
Conversation
b7bab1d to
5dd3185
Compare
55e6f72 to
ae8ee6c
Compare
dhh
reviewed
Mar 9, 2025
|
|
||
| helper.run %(#{helper.bundler_run_cmd} #{name}) if run_script | ||
| end | ||
| }.freeze |
Member
There was a problem hiding this comment.
This is interesting, but too complicated.
Contributor
Author
There was a problem hiding this comment.
I get what you mean, i commited a new version a bit more simpler to read.
ae8ee6c to
27e8fd8
Compare
jbarrieault
reviewed
Mar 11, 2025
Comment on lines
+81
to
+83
| when File.exist?("yarn.lock") then :yarn | ||
| when File.exist?("bun.lockb") then :bun | ||
| when File.exist?("bun.lock") then :bun |
There was a problem hiding this comment.
The Bun lockfiles should come before yarn.lock, since Bun optionally generates a yarn.lock file.
Contributor
Author
There was a problem hiding this comment.
Good catch, i update
…rates a yarn.lock file
|
Lets review it again, so we fixed #169 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rails/jsbundling-rails#213 (comment)
Summary
This PR enhances the CSS Bundling Rails gem by implementing comprehensive support for multiple JavaScript package managers (Yarn, Bun, PNPM, and NPM) with improved detection logic and consistent behavior.
Changes
Technical Details
TOOLS_COMMANDSconstant mapping each package manager to its specific commandsSCRIPT_STRATEGIESto handle package.json script modifications per package managertool_determined_by_config_fileandtool_determined_by_executableThis change enhances developer experience by providing better support for their preferred package manager while maintaining backward compatibility.